﻿using Furion.DatabaseAccessor;
using Furion.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Mrhd.Core.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Mrhd.Application
{
    public class BuinsssService : IBusinessService, IScoped
    {
        private readonly IRepository<BusinessEntity> _repository;
        public BuinsssService(IRepository<BusinessEntity> repository)
        {
            _repository = repository;
        }

        public async Task<BusinessEntity> Create(BusinessEntity business)
        {
            business.CreatedTime = DateTimeOffset.Now;
            await _repository.SaveNowAsync();
            return business;
        }

    }
}
